dst = {}
with open('sample.txt','r',encoding='utf-8') as f:
    for i in f:
        i_new = i.replace('(', ' ').replace(')', ' ').replace('\\', ' ').replace('.', ' ').replace(',', ' ').replace('/', ' ')
        for ii in i_new.split():
            ii = ii.lower()
            dst[ii] = 1 if ii not in dst else dst[ii] + 1

print(sorted(dst.items(), key=lambda x:x[1],reverse=True)[:10])


# 分词效率有点差，可以再做优化
